/***********************************************************************
filename: 	EP3DRay2.h
created:	10/2/2009
author:		Hongjiang Zhang
Email:		chrisntywyat@163.com

purpose:	
*************************************************************************/
#ifndef EP3D_RAY2_H
#define EP3D_RAY2_H
#include "EP3DBase.h"
#include "EP3DVector2.h"

namespace EP3D
{
	template<class T>
	class Ray2
	{
	public:
		Ray2();
		Ray2(const Vector2<T>& rkOrigin, const Vector2<T>& rkDirection);

		Vector2<T> GetPoint(T t) const;
	public:
		Vector2<T> m_rkOrigin, m_rkDirection;
	};

	template<class T>
	Ray2<T>::Ray2()
	{}

	template<class T>
	Ray2<T>::Ray2(const Vector2<T> &rkOrigin, const Vector2<T> &rkDirection)
		:m_rkOrigin(rkOrigin),
		m_rkDirection(rkDirection)
	{}

	template<class T>
	Vector2<T> Ray2<T>::GetPoint(T t) const
	{
		return Vector2<T>(m_rkOrigin + (t * m_rkDirection));
	}

	typedef Ray2<f32> Ray2f;
	typedef Ray2<f64> Ray2d;
}

#endif